﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BiliBiliCSharpStudy.old {
    class FormDemo1 {
        public static void demo() {
            test1();
        }
        public static void test1() {
            Form myForm = new Form();
            myForm.Text = "Hello";
            myForm.Load += MyForm_Load;
            myForm.ShowDialog();
        }

        private static void MyForm_Load(object sender, EventArgs e) {
            Form form = sender as Form;
            if (form == null) {
                return;
            }
            form.Text = "New title";
        }
    }
}
